//
//  TTIFont.m
//  iOSCodeProject
//
//  Created by Fox on 14-7-19.
//  Copyright (c) 2014年 翔傲信息科技（上海）有限公司. All rights reserved.
//

#import "TTIFont.h"

@implementation TTIFont

+ (void)showAllSystemFonts{
    NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
    NSArray *fontNames;
    NSInteger indFamily, indFont;
    for (indFamily=0; indFamily<[familyNames count]; ++indFamily)
    {
        NSLog(@"ICFont Index:%d   Family name: %@",indFamily, [familyNames objectAtIndex:indFamily]);
        fontNames = [[NSArray alloc] initWithArray:
                     [UIFont fontNamesForFamilyName:
                      [familyNames objectAtIndex:indFamily]]];
        for (indFont=0; indFont<[fontNames count]; ++indFont)
        {
            NSLog(@" Font name: %@", [fontNames objectAtIndex:indFont]);
        }
    }
}

+ (UIFont *)getCommonFontWithSize:(float )size{
    return [UIFont fontWithName:@"KaiTi_GB2312" size:size];
}

+ (CGFloat)lineHeight:(UIFont *)font{
    return (font.ascender - font.descender) + 1;
}

@end
